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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

c.r = j
c.x = f
c.w = e
c.s = d
c.u = n
h.o = c
h.w = d
i.r = k
i.z = k
i.v = j
j.x = k
j.y = k
d.r = k
f.t = i
f.q = n
f.y = n
f.s = c
k.r = i
k.z = i
k.v = j
n.r = i
e.o = c
e.w = n
b.t = k
b.q = n
b.y = n
b.s = c
assert k.v.y.r.v.y.z.z.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: F = None
        self.w: B = None
        self.s: E = None
        self.u: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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