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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: F = None
        self.q: A = None
        self.x: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.y: A = None
        self.w: B = None
        self.o: A = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: F = None
        self.q: A = None
        self.x: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.y: A = None
        self.w: B = None
        self.o: A = None
        self.q: A = None
        self.txt = txt

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

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

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

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

h.o = l
d.w = j
d.s = g
d.q = h
d.x = n
d.u = b
c.r = l
c.t = l
c.y = h
c.o = h
c.q = h
c.w = d
f.t = h
f.r = h
f.z = g
n.w = h
n.r = h
n.u = f
g.s = b
g.o = h
g.w = d
j.t = l
j.r = h
j.z = g
b.w = l
b.r = l
b.u = f
l.o = h
assert l.o.o.o.txt == "h"