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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: A = None
        self.y: B = None
        self.w: A = None
        self.u: A = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: A = None
        self.y: B = None
        self.w: A = None
        self.u: A = None
        self.z: C = None
        self.txt = txt

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

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

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

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