class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: G = None
        self.o: E = None
        self.p: C = None
        self.u: C = 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.x: E = None
        self.o: A = None
        self.s: D = None
        self.y: G = None
        self.t: D = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: A = None
        self.q: B = None
        self.w: D = None
        self.p: D = None
        self.o: F = None
        self.x: E = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: F = None
        self.w: D = None
        self.s: H = None
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

d.x = e
d.w = h
d.o = c
d.p = b
d.u = b
e.u = f
b.x = c
b.o = d
b.s = m
b.q = m
b.y = h
b.t = j
j.t = h
j.z = d
j.q = e
j.w = m
j.p = m
j.o = f
j.x = c
j.r = l
c.o = a
c.r = a
c.w = m
c.z = m
c.s = l
f.r = h
f.w = e
f.p = e
f.t = l
f.u = a
h.x = f
l.q = m
m.t = h
m.z = d
m.q = e
m.w = j
m.p = j
m.o = f
m.x = c
m.r = l
a.r = h
a.w = e
a.p = e
a.t = l
a.u = f
assert d.w.x.r.x.t.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: G = None
        self.o: E = None
        self.p: C = None
        self.u: C = 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.x: E = None
        self.o: A = None
        self.s: D = None
        self.y: G = None
        self.t: D = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: A = None
        self.q: B = None
        self.w: D = None
        self.p: D = None
        self.o: F = None
        self.x: E = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: F = None
        self.w: D = None
        self.s: H = None
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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