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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: G = None
        self.v: A = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.r: A = None
        self.x: A = None
        self.p: A = None
        self.t: D = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.z: D = None
        self.v: A = None
        self.s: G = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: G = None
        self.v: A = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.r: A = None
        self.x: A = None
        self.p: A = None
        self.t: D = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.z: D = None
        self.v: A = None
        self.s: G = None
        self.u: C = None
        self.txt = txt

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

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

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