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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: D = None
        self.w: F = None
        self.o: D = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.r: B = None
        self.p: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: D = None
        self.w: F = None
        self.o: D = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.r: B = None
        self.p: E = None
        self.txt = txt

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

b.o = c
b.w = d
b.x = e
h.s = l
h.u = d
h.t = j
n.v = j
n.x = j
n.o = j
n.w = d
n.q = c
j.x = e
f.v = n
f.o = c
d.q = j
d.s = k
d.r = h
d.p = f
c.q = j
c.s = k
c.p = k
c.r = h
e.o = c
e.w = c
e.x = b
l.v = n
l.o = d
k.v = n
k.o = c
assert d.r.t.x.x.w.p.o.txt == "c"