class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: B = None
        self.x: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = None
        self.x: G = None
        self.p: C = None
        self.w: G = None
        self.z: A = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: A = None
        self.txt = txt

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

c = A("c")
j = B("j")
k = C("k")
m = D("m")
h = E("h")
i = F("i")
e = G("e")
a = D("a")
f = C("f")

c.p = i
c.t = j
c.x = a
j.o = c
j.r = h
k.r = f
k.p = i
k.u = i
k.z = m
k.o = h
k.q = c
m.t = h
m.z = e
m.w = i
m.r = a
h.r = i
h.t = i
h.x = e
h.w = e
h.v = e
h.p = f
h.z = c
i.x = h
i.q = c
e.q = h
e.o = c
a.t = h
a.z = e
a.w = i
a.r = m
f.r = k
f.p = i
f.u = i
f.z = a
f.o = h
f.q = c
assert e.q.p.r.r.p.x.z.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: B = None
        self.x: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = None
        self.x: G = None
        self.p: C = None
        self.w: G = None
        self.z: A = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: A = None
        self.txt = txt

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

c = A("c")
j = B("j")
k = C("k")
m = D("m")
h = E("h")
i = F("i")
e = G("e")
a = D("a")
f = C("f")

c.p = i
c.t = j
c.x = a
j.o = c
j.r = h
k.r = f
k.p = i
k.u = i
k.z = m
k.o = h
k.q = c
m.t = h
m.z = e
m.w = i
m.r = a
h.r = i
h.t = i
h.x = e
h.w = e
h.v = e
h.p = f
h.z = c
i.x = h
i.q = c
e.q = h
e.o = c
a.t = h
a.z = e
a.w = i
a.r = m
f.r = k
f.p = i
f.u = i
f.z = a
f.o = h
f.q = c
assert e.q.p.r.r.p.x.z.t.o.txt == "c"