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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: E = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.r: C = None
        self.o: A = None
        self.v: B = None
        self.w: A = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

e = A("e")
h = B("h")
g = C("g")
k = D("k")
f = E("f")
a = F("a")
m = G("m")
n = A("n")
d = E("d")

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: E = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.r: C = None
        self.o: A = None
        self.v: B = None
        self.w: A = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

e = A("e")
h = B("h")
g = C("g")
k = D("k")
f = E("f")
a = F("a")
m = G("m")
n = A("n")
d = E("d")

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