class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: G = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: A = None
        self.x: B = None
        self.p: A = None
        self.z: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.z: B = None
        self.w: F = None
        self.o: A = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: A = None
        self.x: B = None
        self.p: A = None
        self.z: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.z: B = None
        self.w: F = None
        self.o: A = None
        self.t: E = None
        self.txt = txt

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

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