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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: B = None
        self.r: B = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: A = None
        self.v: C = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.q: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: B = None
        self.r: B = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: A = None
        self.v: C = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.q: C = None
        self.txt = txt

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

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