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

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

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

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

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

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

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

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

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

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

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

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

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

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

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