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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: E = None
        self.v: D = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: E = None
        self.v: D = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: B = None
        self.txt = txt

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

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

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

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