class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: G = None
        self.r: H = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: E = None
        self.x: D = None
        self.r: E = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: A = None
        self.x: C = None
        self.o: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: B = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: E = None
        self.u: C = None
        self.txt = txt

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

c = A("c")
l = B("l")
b = C("b")
a = D("a")
k = E("k")
j = F("j")
g = G("g")
f = H("f")
n = I("n")

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: E = None
        self.x: D = None
        self.r: E = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: A = None
        self.x: C = None
        self.o: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: B = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: E = None
        self.u: C = None
        self.txt = txt

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

c = A("c")
l = B("l")
b = C("b")
a = D("a")
k = E("k")
j = F("j")
g = G("g")
f = H("f")
n = I("n")

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