class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: F = None
        self.x: C = None
        self.s: F = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: F = None
        self.x: C = None
        self.s: F = None
        self.v: D = None
        self.txt = txt

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

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