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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: D = None
        self.u: B = None
        self.t: B = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: D = None
        self.u: B = None
        self.t: B = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

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

c.t = n
c.w = n
c.y = a
c.s = h
c.q = h
c.o = f
n.y = b
n.t = c
f.t = b
h.x = b
h.z = b
h.u = a
b.t = a
b.o = a
b.r = f
b.u = h
a.o = b
a.v = h
a.p = h
a.u = n
a.t = n
a.x = c
d.t = n
d.w = n
d.y = a
d.s = h
d.q = h
d.o = f
assert n.t.w.t.s.x.r.t.txt == "b"