class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: E = None
        self.q: F = None
        self.o: C = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: F = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: E = None
        self.q: A = None
        self.p: A = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: A = None
        self.t: B = None
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: F = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: E = None
        self.q: A = None
        self.p: A = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: A = None
        self.t: B = None
        self.x: A = None
        self.txt = txt

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

d.x = n
d.o = n
d.u = b
d.q = m
d.t = m
e.q = n
e.y = n
e.t = m
n.x = d
f.v = m
f.y = h
f.q = d
f.p = d
f.w = e
b.u = e
b.w = m
b.p = f
m.y = n
m.q = d
m.x = d
m.t = e
h.u = a
h.w = m
h.p = f
a.q = n
a.y = n
a.t = m
assert m.y.x.t.t.txt == "e"