class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: F = None
        self.r: G = None
        self.p: D = None
        self.o: F = None
        self.x: B = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: F = None
        self.u: G = None
        self.o: G = None
        self.v: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: F = None
        self.u: G = None
        self.o: G = None
        self.v: C = None
        self.txt = txt

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

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

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

a.z = m
a.u = m
a.o = m
a.r = k
a.p = l
a.s = l
a.x = h
h.y = m
h.x = d
b.z = e
b.r = a
b.w = f
l.v = e
e.r = m
e.w = m
e.u = k
e.o = k
e.v = b
m.r = a
k.z = e
k.x = b
k.p = l
f.y = m
f.x = d
d.r = m
d.w = m
d.u = k
d.o = k
d.v = b
assert h.y.r.s.v.u.x.txt == "b"