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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: E = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: A = None
        self.w: A = None
        self.v: A = None
        self.x: G = None
        self.r: A = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: H = None
        self.q: A = None
        self.w: C = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: A = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.x: F = None
        self.s: C = None
        self.t: F = None
        self.o: G = None
        self.txt = txt

a = A("a")
c = B("c")
g = C("g")
m = D("m")
f = E("f")
n = F("n")
l = G("l")
e = H("e")
j = G("j")
d = C("d")

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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: E = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: A = None
        self.w: A = None
        self.v: A = None
        self.x: G = None
        self.r: A = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: H = None
        self.q: A = None
        self.w: C = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: A = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.x: F = None
        self.s: C = None
        self.t: F = None
        self.o: G = None
        self.txt = txt

a = A("a")
c = B("c")
g = C("g")
m = D("m")
f = E("f")
n = F("n")
l = G("l")
e = H("e")
j = G("j")
d = C("d")

a.t = f
a.q = n
a.w = c
c.x = a
c.v = d
g.w = e
g.z = f
g.v = n
m.z = d
m.u = a
m.w = a
m.v = a
m.r = a
m.x = j
m.q = c
f.w = l
f.r = a
n.s = f
n.r = e
n.q = a
n.w = d
n.p = l
l.u = g
l.q = a
l.x = f
e.p = f
e.z = a
e.x = n
e.t = n
e.s = d
e.o = l
j.u = d
j.q = a
j.x = f
d.w = e
d.z = f
d.v = n
assert m.r.t.r.txt == "a"