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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.p: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: F = None
        self.x: E = None
        self.q: D = None
        self.r: D = None
        self.p: E = None
        self.txt = txt

g = A("g")
b = B("b")
l = C("l")
h = D("h")
e = E("e")
a = F("a")
k = G("k")

g.y = b
g.t = l
g.x = k
b.u = l
b.t = e
b.p = g
b.s = a
l.o = a
l.t = a
l.y = h
l.q = h
l.z = k
h.q = e
e.t = k
e.x = b
e.u = h
a.w = g
k.v = h
k.q = h
k.r = h
k.u = a
k.x = e
k.p = e
assert h.q.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: C = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.p: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: F = None
        self.x: E = None
        self.q: D = None
        self.r: D = None
        self.p: E = None
        self.txt = txt

g = A("g")
b = B("b")
l = C("l")
h = D("h")
e = E("e")
a = F("a")
k = G("k")

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