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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: D = None
        self.y: C = None
        self.r: B = None
        self.t: C = None
        self.u: B = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: D = None
        self.y: C = None
        self.r: B = None
        self.t: C = None
        self.u: B = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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