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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: F = None
        self.y: B = None
        self.q: F = None
        self.u: E = None
        self.x: E = None
        self.txt = txt

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

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

d = A("d")
e = B("e")
k = C("k")
m = D("m")
n = E("n")
l = F("l")

d.o = l
d.u = l
d.s = m
d.z = e
d.v = e
d.q = n
e.p = n
e.y = d
k.t = m
k.s = m
k.w = n
k.x = n
k.p = l
m.p = n
m.u = n
m.x = n
m.z = l
m.q = l
m.y = e
n.u = k
n.y = e
l.w = k
assert n.u.x.y.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: D = None
        self.z: B = None
        self.q: E = None
        self.u: F = None
        self.v: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: F = None
        self.y: B = None
        self.q: F = None
        self.u: E = None
        self.x: E = None
        self.txt = txt

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

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

d = A("d")
e = B("e")
k = C("k")
m = D("m")
n = E("n")
l = F("l")

d.o = l
d.u = l
d.s = m
d.z = e
d.v = e
d.q = n
e.p = n
e.y = d
k.t = m
k.s = m
k.w = n
k.x = n
k.p = l
m.p = n
m.u = n
m.x = n
m.z = l
m.q = l
m.y = e
n.u = k
n.y = e
l.w = k
assert n.u.x.y.y.u.txt == "l"