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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: D = None
        self.z: F = None
        self.o: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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

j.y = l
j.u = k
j.p = h
f.z = l
f.v = l
g.q = k
g.s = k
g.o = k
g.z = l
g.y = f
k.q = h
k.x = l
k.z = n
k.s = f
n.q = e
n.r = e
n.u = f
l.z = g
l.o = c
l.q = h
l.u = f
e.q = n
e.r = n
e.u = f
h.y = l
h.u = k
h.p = j
c.q = k
c.s = k
c.o = k
c.z = l
c.y = f
assert k.z.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: D = None
        self.p: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: D = None
        self.z: F = None
        self.o: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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

j.y = l
j.u = k
j.p = h
f.z = l
f.v = l
g.q = k
g.s = k
g.o = k
g.z = l
g.y = f
k.q = h
k.x = l
k.z = n
k.s = f
n.q = e
n.r = e
n.u = f
l.z = g
l.o = c
l.q = h
l.u = f
e.q = n
e.r = n
e.u = f
h.y = l
h.u = k
h.p = j
c.q = k
c.s = k
c.o = k
c.z = l
c.y = f
assert k.z.q.q.txt == "n"