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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: I = None
        self.q: I = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: A = None
        self.w: A = None
        self.y: C = None
        self.q: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: I = None
        self.q: I = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: A = None
        self.w: A = None
        self.y: C = None
        self.q: F = None
        self.v: F = None
        self.txt = txt

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

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

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