class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: E = None
        self.p: B = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: A = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: E = None
        self.s: H = None
        self.p: G = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.p: C = None
        self.v: E = None
        self.z: G = None
        self.y: E = None
        self.q: A = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: E = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: D = None
        self.txt = txt

g = A("g")
b = B("b")
d = C("d")
j = D("j")
m = E("m")
h = F("h")
l = G("l")
c = H("c")
f = H("f")

g.r = l
g.o = m
g.t = m
g.p = b
b.y = h
b.s = g
b.t = j
d.r = l
j.z = b
j.w = m
j.s = f
j.p = l
j.v = h
m.s = l
h.w = d
h.x = d
h.p = d
h.v = m
h.y = m
h.z = l
h.q = g
h.t = f
l.u = h
l.v = m
l.q = b
c.z = h
c.q = j
f.z = h
f.q = j
assert c.q.s.z.t.q.s.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: E = None
        self.p: B = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: A = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: E = None
        self.s: H = None
        self.p: G = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.p: C = None
        self.v: E = None
        self.z: G = None
        self.y: E = None
        self.q: A = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: E = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: D = None
        self.txt = txt

g = A("g")
b = B("b")
d = C("d")
j = D("j")
m = E("m")
h = F("h")
l = G("l")
c = H("c")
f = H("f")

g.r = l
g.o = m
g.t = m
g.p = b
b.y = h
b.s = g
b.t = j
d.r = l
j.z = b
j.w = m
j.s = f
j.p = l
j.v = h
m.s = l
h.w = d
h.x = d
h.p = d
h.v = m
h.y = m
h.z = l
h.q = g
h.t = f
l.u = h
l.v = m
l.q = b
c.z = h
c.q = j
f.z = h
f.q = j
assert c.q.s.z.t.q.s.z.y.txt == "m"