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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: G = None
        self.v: G = None
        self.txt = txt

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

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

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

k = A("k")
m = B("m")
b = C("b")
g = D("g")
i = E("i")
h = F("h")
f = G("f")
e = C("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: G = None
        self.v: G = None
        self.txt = txt

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

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

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

k = A("k")
m = B("m")
b = C("b")
g = D("g")
i = E("i")
h = F("h")
f = G("f")
e = C("e")

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