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

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

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

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

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

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

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

l.o = d
a.u = f
a.q = f
a.p = i
d.u = i
g.y = n
g.z = i
i.y = d
n.x = f
n.y = f
n.u = g
f.u = a
f.q = a
f.p = i
h.x = a
h.y = a
h.u = g
e.x = f
e.y = f
e.u = g
b.o = d
assert i.y.u.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

l.o = d
a.u = f
a.q = f
a.p = i
d.u = i
g.y = n
g.z = i
i.y = d
n.x = f
n.y = f
n.u = g
f.u = a
f.q = a
f.p = i
h.x = a
h.y = a
h.u = g
e.x = f
e.y = f
e.u = g
b.o = d
assert i.y.u.y.u.txt == "i"