class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: F = None
        self.u: D = None
        self.r: A = None
        self.t: F = None
        self.y: C = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: F = None
        self.u: D = None
        self.r: A = None
        self.t: F = None
        self.y: C = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

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