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

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

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

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

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

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

i = A("i")
c = B("c")
m = C("m")
j = D("j")
d = E("d")
h = F("h")
a = E("a")
k = D("k")
f = B("f")

i.s = f
i.w = m
c.s = i
c.x = k
m.x = c
m.v = i
j.w = a
j.v = h
j.u = i
j.x = c
j.p = c
j.o = m
d.t = k
d.x = j
h.w = f
h.u = f
a.t = j
a.x = j
k.w = a
k.v = h
k.u = i
k.x = f
k.p = c
k.o = m
f.s = i
f.x = k
assert d.x.w.x.v.w.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

i = A("i")
c = B("c")
m = C("m")
j = D("j")
d = E("d")
h = F("h")
a = E("a")
k = D("k")
f = B("f")

i.s = f
i.w = m
c.s = i
c.x = k
m.x = c
m.v = i
j.w = a
j.v = h
j.u = i
j.x = c
j.p = c
j.o = m
d.t = k
d.x = j
h.w = f
h.u = f
a.t = j
a.x = j
k.w = a
k.v = h
k.u = i
k.x = f
k.p = c
k.o = m
f.s = i
f.x = k
assert d.x.w.x.v.w.x.u.txt == "i"