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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: F = None
        self.u: E = None
        self.w: B = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

f = A("f")
h = B("h")
c = C("c")
b = D("b")
a = E("a")
l = F("l")
i = A("i")
j = E("j")
n = C("n")

f.x = h
f.q = h
f.o = i
h.v = l
c.p = a
c.u = a
c.x = l
c.w = h
c.o = i
b.z = f
b.q = f
b.w = l
b.r = a
a.z = c
a.y = b
l.q = f
i.x = h
i.q = h
i.o = f
j.z = c
j.y = b
n.p = j
n.u = j
n.x = l
n.w = h
n.o = f
assert c.o.x.v.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: A = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: F = None
        self.u: E = None
        self.w: B = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

f = A("f")
h = B("h")
c = C("c")
b = D("b")
a = E("a")
l = F("l")
i = A("i")
j = E("j")
n = C("n")

f.x = h
f.q = h
f.o = i
h.v = l
c.p = a
c.u = a
c.x = l
c.w = h
c.o = i
b.z = f
b.q = f
b.w = l
b.r = a
a.z = c
a.y = b
l.q = f
i.x = h
i.q = h
i.o = f
j.z = c
j.y = b
n.p = j
n.u = j
n.x = l
n.w = h
n.o = f
assert c.o.x.v.q.q.txt == "h"