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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: B = None
        self.y: D = None
        self.r: H = None
        self.o: B = None
        self.u: H = None
        self.x: G = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: E = None
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: D = None
        self.z: A = None
        self.y: C = None
        self.x: F = None
        self.v: C = None
        self.p: F = None
        self.o: C = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: B = None
        self.y: D = None
        self.r: H = None
        self.o: B = None
        self.u: H = None
        self.x: G = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: E = None
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: D = None
        self.z: A = None
        self.y: C = None
        self.x: F = None
        self.v: C = None
        self.p: F = None
        self.o: C = None
        self.w: B = None
        self.txt = txt

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

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

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

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