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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: F = None
        self.r: E = None
        self.o: E = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: F = None
        self.r: F = None
        self.x: F = None
        self.y: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: F = None
        self.r: E = None
        self.o: E = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: F = None
        self.r: F = None
        self.x: F = None
        self.y: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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