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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: D = None
        self.y: E = None
        self.r: D = None
        self.s: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: E = None
        self.y: C = None
        self.r: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: D = None
        self.y: E = None
        self.r: D = None
        self.s: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: E = None
        self.y: C = None
        self.r: B = None
        self.txt = txt

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

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

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