class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: H = None
        self.o: G = None
        self.t: H = None
        self.p: I = None
        self.w: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.o: F = None
        self.v: H = None
        self.q: H = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: H = None
        self.o: G = None
        self.t: H = None
        self.p: I = None
        self.w: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.o: F = None
        self.v: H = None
        self.q: H = None
        self.z: F = None
        self.txt = txt

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

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