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

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

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

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

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

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

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

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

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

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

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

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

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

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

e.u = g
d.s = i
d.x = n
d.q = f
d.z = f
d.u = l
d.p = e
l.u = e
l.x = f
i.v = b
i.r = b
g.z = n
g.w = e
g.u = d
g.p = i
f.u = b
f.v = h
f.z = h
f.r = e
f.q = e
f.o = n
n.z = g
n.w = e
n.u = d
n.p = b
b.v = i
b.r = i
h.u = b
h.v = f
h.z = f
h.r = e
h.q = e
h.o = g
assert e.u.p.r.v.v.v.v.v.txt == "i"