class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: E = None
        self.v: D = None
        self.u: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: F = None
        self.q: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: F = None
        self.q: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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