class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: E = None
        self.z: D = None
        self.r: G = None
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: I = None
        self.z: F = None
        self.q: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: E = None
        self.t: H = None
        self.r: C = None
        self.w: A = None
        self.y: E = None
        self.v: H = None
        self.s: D = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: D = None
        self.p: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: G = None
        self.txt = txt

h = A("h")
f = B("f")
b = C("b")
c = D("c")
g = E("g")
e = F("e")
d = G("d")
l = H("l")
n = I("n")

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: I = None
        self.z: F = None
        self.q: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: E = None
        self.t: H = None
        self.r: C = None
        self.w: A = None
        self.y: E = None
        self.v: H = None
        self.s: D = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: D = None
        self.p: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: G = None
        self.txt = txt

h = A("h")
f = B("f")
b = C("b")
c = D("c")
g = E("g")
e = F("e")
d = G("d")
l = H("l")
n = I("n")

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