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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: E = None
        self.o: F = None
        self.q: F = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: G = None
        self.w: A = None
        self.s: E = None
        self.y: A = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: D = None
        self.u: A = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: E = None
        self.o: F = None
        self.q: F = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: G = None
        self.w: A = None
        self.s: E = None
        self.y: A = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: D = None
        self.u: A = None
        self.x: D = None
        self.txt = txt

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

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