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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: I = None
        self.w: H = None
        self.q: F = None
        self.y: C = None
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: B = None
        self.z: H = None
        self.w: E = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: C = None
        self.r: A = None
        self.x: I = None
        self.txt = txt

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

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

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

a.p = c
a.q = l
a.x = l
a.z = j
a.o = f
j.o = f
j.p = e
j.w = c
j.q = k
j.y = n
j.t = h
n.y = f
n.u = j
n.t = e
h.t = d
d.t = n
k.p = f
k.q = j
k.z = c
k.r = c
k.w = d
f.t = a
f.q = n
f.r = l
f.x = e
c.p = h
c.t = n
e.r = d
l.p = c
l.q = a
l.x = a
l.z = j
l.o = f
assert f.r.q.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: A = None
        self.z: B = None
        self.o: G = None
        self.x: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: I = None
        self.w: H = None
        self.q: F = None
        self.y: C = None
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: B = None
        self.z: H = None
        self.w: E = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: C = None
        self.r: A = None
        self.x: I = None
        self.txt = txt

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

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

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

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