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

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: C = None
        self.s: F = None
        self.q: C = None
        self.y: D = None
        self.txt = txt

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

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

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

l.r = a
l.x = j
c.r = h
c.v = b
c.y = k
h.r = i
h.v = c
h.t = c
h.p = j
n.o = k
n.u = h
n.q = h
n.s = j
n.y = a
b.q = i
j.u = i
k.u = i
i.r = n
i.x = j
a.o = k
a.u = h
a.q = h
a.s = j
a.y = n
assert c.r.r.r.y.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: C = None
        self.s: F = None
        self.q: C = None
        self.y: D = None
        self.txt = txt

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

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

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

l.r = a
l.x = j
c.r = h
c.v = b
c.y = k
h.r = i
h.v = c
h.t = c
h.p = j
n.o = k
n.u = h
n.q = h
n.s = j
n.y = a
b.q = i
j.u = i
k.u = i
i.r = n
i.x = j
a.o = k
a.u = h
a.q = h
a.s = j
a.y = n
assert c.r.r.r.y.y.o.txt == "k"