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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.y: G = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: D = None
        self.t: H = None
        self.x: A = None
        self.o: E = None
        self.y: H = None
        self.v: A = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: B = None
        self.x: E = None
        self.s: H = None
        self.v: G = None
        self.q: E = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: B = None
        self.txt = txt

f = A("f")
l = B("l")
j = C("j")
m = D("m")
n = E("n")
d = F("d")
h = G("h")
g = H("g")
i = G("i")
b = A("b")

f.o = b
l.y = d
l.p = i
j.u = d
m.u = l
m.z = d
n.u = l
n.t = m
n.y = h
n.z = g
d.r = b
d.x = b
d.v = b
d.u = m
d.t = g
d.y = g
d.o = n
d.p = l
h.p = m
h.u = l
h.x = n
h.q = n
h.w = n
h.s = g
h.v = i
g.u = l
g.p = l
i.p = m
i.u = l
i.x = n
i.q = n
i.w = n
i.s = g
i.v = h
b.o = f
assert f.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.y: F = None
        self.p: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.y: G = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: D = None
        self.t: H = None
        self.x: A = None
        self.o: E = None
        self.y: H = None
        self.v: A = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: B = None
        self.x: E = None
        self.s: H = None
        self.v: G = None
        self.q: E = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: B = None
        self.txt = txt

f = A("f")
l = B("l")
j = C("j")
m = D("m")
n = E("n")
d = F("d")
h = G("h")
g = H("g")
i = G("i")
b = A("b")

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