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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.t: F = None
        self.w: F = None
        self.u: C = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.t: F = None
        self.w: F = None
        self.u: C = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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