class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: F = None
        self.r: E = None
        self.p: F = None
        self.v: F = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: B = None
        self.p: A = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: F = None
        self.s: A = None
        self.u: C = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

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

b = A("b")
j = B("j")
f = C("f")
l = D("l")
c = E("c")
h = F("h")
i = F("i")
n = F("n")
e = B("e")

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: B = None
        self.p: A = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: F = None
        self.s: A = None
        self.u: C = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

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

b = A("b")
j = B("j")
f = C("f")
l = D("l")
c = E("c")
h = F("h")
i = F("i")
n = F("n")
e = B("e")

b.u = f
b.z = f
b.x = h
b.p = h
b.r = c
b.v = i
j.v = b
j.s = b
j.w = b
j.u = c
f.s = c
f.y = j
f.p = b
f.w = b
l.t = f
l.u = f
l.p = n
l.s = b
l.r = h
l.v = h
c.z = l
c.p = l
c.o = b
c.q = f
c.u = i
h.w = e
i.w = e
n.w = e
e.v = b
e.s = b
e.w = b
e.u = c
assert f.s.p.p.w.w.v.w.u.u.txt == "i"