class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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