class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: A = None
        self.v: A = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: E = None
        self.v: D = None
        self.r: B = None
        self.x: G = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.q: B = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: H = None
        self.txt = txt

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

l = A("l")
g = B("g")
b = C("b")
h = D("h")
m = E("m")
e = F("e")
i = G("i")
f = H("f")
j = A("j")
n = D("n")

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: E = None
        self.v: D = None
        self.r: B = None
        self.x: G = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.q: B = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: H = None
        self.txt = txt

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

l = A("l")
g = B("g")
b = C("b")
h = D("h")
m = E("m")
e = F("e")
i = G("i")
f = H("f")
j = A("j")
n = D("n")

l.x = g
l.q = j
l.v = j
l.r = m
g.t = l
g.p = b
b.o = g
b.r = g
b.q = m
b.v = h
b.p = h
b.x = i
h.x = i
h.p = g
m.t = g
m.u = h
e.z = m
e.p = l
e.q = g
e.w = g
i.o = m
i.p = f
f.z = h
j.x = g
j.q = l
j.v = l
j.r = m
n.x = i
n.p = g
assert m.t.t.q.r.t.txt == "g"