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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: C = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: E = None
        self.p: B = None
        self.w: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: C = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: E = None
        self.p: B = None
        self.w: C = None
        self.txt = txt

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

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