class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: D = None
        self.t: B = None
        self.q: B = None
        self.y: D = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: F = None
        self.p: F = None
        self.z: A = None
        self.s: A = None
        self.u: D = None
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: E = None
        self.w: A = None
        self.x: B = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: D = None
        self.s: G = None
        self.y: G = None
        self.t: F = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: H = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: E = None
        self.y: B = None
        self.r: H = None
        self.q: E = None
        self.x: G = None
        self.u: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: F = None
        self.p: F = None
        self.z: A = None
        self.s: A = None
        self.u: D = None
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: E = None
        self.w: A = None
        self.x: B = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: D = None
        self.s: G = None
        self.y: G = None
        self.t: F = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: H = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: E = None
        self.y: B = None
        self.r: H = None
        self.q: E = None
        self.x: G = None
        self.u: A = None
        self.txt = txt

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

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