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

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

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

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

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

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

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

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

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

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

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

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

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

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

c.r = f
i.w = l
i.s = f
i.t = j
h.q = k
h.y = i
a.u = c
a.o = i
a.r = i
a.v = l
a.s = h
a.y = k
k.t = h
k.r = j
l.y = i
l.w = h
l.z = c
l.u = f
j.u = c
j.o = i
j.r = i
j.v = l
j.s = h
j.y = k
f.q = k
f.y = i
assert k.r.v.w.q.t.y.t.txt == "j"