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

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

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

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

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

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

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

g = A("g")
j = B("j")
b = C("b")
i = D("i")
d = E("d")
h = F("h")
n = G("n")

g.y = h
j.r = d
j.p = n
j.y = b
b.v = d
i.u = d
i.y = h
i.t = n
i.q = g
i.p = g
i.z = j
i.r = b
d.t = n
d.x = n
d.y = n
d.o = i
d.z = h
d.r = g
h.w = j
h.q = d
n.s = j
n.o = g
assert b.v.o.q.y.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

g = A("g")
j = B("j")
b = C("b")
i = D("i")
d = E("d")
h = F("h")
n = G("n")

g.y = h
j.r = d
j.p = n
j.y = b
b.v = d
i.u = d
i.y = h
i.t = n
i.q = g
i.p = g
i.z = j
i.r = b
d.t = n
d.x = n
d.y = n
d.o = i
d.z = h
d.r = g
h.w = j
h.q = d
n.s = j
n.o = g
assert b.v.o.q.y.q.z.txt == "h"