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

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

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

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

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

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

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

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

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

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

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

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

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

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

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