class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: E = None
        self.x: G = None
        self.v: C = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: H = None
        self.v: C = None
        self.o: I = None
        self.s: E = None
        self.u: H = None
        self.p: I = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: H = None
        self.v: C = None
        self.o: I = None
        self.s: E = None
        self.u: H = None
        self.p: I = None
        self.txt = txt

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

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

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

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

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