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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.s: G = None
        self.v: G = None
        self.o: G = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.s: G = None
        self.v: G = None
        self.o: G = None
        self.r: F = None
        self.txt = txt

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

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