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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.p: A = None
        self.v: D = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.p: A = None
        self.v: D = None
        self.r: F = None
        self.txt = txt

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

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

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