class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: E = None
        self.s: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: B = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: B = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

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