class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: B = None
        self.x: F = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

l.p = k
l.x = k
l.r = k
l.y = b
h.v = l
h.r = l
h.w = d
h.z = e
h.y = n
n.o = k
a.u = e
e.q = d
e.u = n
k.o = n
k.z = e
g.p = k
g.x = k
g.r = k
g.y = b
d.p = k
d.x = k
d.r = k
d.y = h
b.v = g
b.r = g
b.w = d
b.z = e
b.y = n
assert n.o.o.o.txt == "k"