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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: D = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: F = None
        self.o: A = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: G = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: G = None
        self.v: E = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: D = None
        self.o: F = None
        self.u: B = None
        self.w: C = None
        self.r: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: D = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: F = None
        self.o: A = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: G = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: G = None
        self.v: E = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: D = None
        self.o: F = None
        self.u: B = None
        self.w: C = None
        self.r: F = None
        self.txt = txt

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

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