class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: F = None
        self.w: E = None
        self.u: E = None
        self.p: D = None
        self.s: C = None
        self.t: B = None
        self.v: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: C = None
        self.x: H = None
        self.t: F = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: C = None
        self.r: H = None
        self.z: A = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: H = None
        self.v: I = None
        self.z: H = None
        self.p: H = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: F = None
        self.o: F = None
        self.p: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: D = None
        self.y: I = None
        self.q: D = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: C = None
        self.x: H = None
        self.t: F = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: C = None
        self.r: H = None
        self.z: A = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: H = None
        self.v: I = None
        self.z: H = None
        self.p: H = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: F = None
        self.o: F = None
        self.p: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: D = None
        self.y: I = None
        self.q: D = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

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

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