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

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

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

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

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

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

j = A("j")
d = B("d")
l = C("l")
a = D("a")
n = E("n")
m = F("m")

j.t = l
j.s = m
d.r = l
l.v = a
a.v = m
a.u = m
a.p = l
a.o = d
a.y = d
a.q = j
n.r = l
n.u = a
m.x = d
m.v = n
m.u = j
assert a.o.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

j = A("j")
d = B("d")
l = C("l")
a = D("a")
n = E("n")
m = F("m")

j.t = l
j.s = m
d.r = l
l.v = a
a.v = m
a.u = m
a.p = l
a.o = d
a.y = d
a.q = j
n.r = l
n.u = a
m.x = d
m.v = n
m.u = j
assert a.o.r.v.txt == "a"