class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: C = None
        self.v: B = None
        self.s: F = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: D = None
        self.w: B = None
        self.t: D = None
        self.q: F = None
        self.v: E = None
        self.txt = txt

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

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

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

i = A("i")
e = B("e")
a = C("a")
n = D("n")
g = E("g")
m = F("m")
j = B("j")
d = A("d")

i.x = m
i.s = m
i.t = a
i.v = e
i.y = n
e.s = j
e.x = i
e.u = d
a.p = i
a.z = n
a.t = n
a.w = e
a.q = m
a.v = g
n.p = d
g.s = e
g.w = m
m.y = d
j.s = e
j.x = d
j.u = d
d.x = m
d.s = m
d.t = a
d.v = j
d.y = n
assert n.p.v.s.u.v.s.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: C = None
        self.v: B = None
        self.s: F = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: D = None
        self.w: B = None
        self.t: D = None
        self.q: F = None
        self.v: E = None
        self.txt = txt

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

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

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

i = A("i")
e = B("e")
a = C("a")
n = D("n")
g = E("g")
m = F("m")
j = B("j")
d = A("d")

i.x = m
i.s = m
i.t = a
i.v = e
i.y = n
e.s = j
e.x = i
e.u = d
a.p = i
a.z = n
a.t = n
a.w = e
a.q = m
a.v = g
n.p = d
g.s = e
g.w = m
m.y = d
j.s = e
j.x = d
j.u = d
d.x = m
d.s = m
d.t = a
d.v = j
d.y = n
assert n.p.v.s.u.v.s.s.x.txt == "d"