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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: C = None
        self.t: G = None
        self.p: F = None
        self.w: B = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: G = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: H = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: D = None
        self.y: F = None
        self.o: G = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: C = None
        self.t: G = None
        self.p: F = None
        self.w: B = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: G = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: H = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: D = None
        self.y: F = None
        self.o: G = None
        self.t: D = None
        self.txt = txt

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

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