class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: E = None
        self.s: B = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: D = None
        self.r: C = None
        self.w: D = None
        self.u: E = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

m.v = n
m.y = a
m.s = c
m.w = d
c.z = a
c.u = a
c.y = j
c.w = j
c.q = j
c.r = n
d.x = c
j.t = i
j.y = a
a.w = c
i.r = m
i.w = g
i.o = j
g.v = d
g.y = a
g.s = c
g.w = n
n.x = c
l.r = g
l.w = m
l.o = j
assert j.t.o.y.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: E = None
        self.s: B = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: D = None
        self.r: C = None
        self.w: D = None
        self.u: E = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

m.v = n
m.y = a
m.s = c
m.w = d
c.z = a
c.u = a
c.y = j
c.w = j
c.q = j
c.r = n
d.x = c
j.t = i
j.y = a
a.w = c
i.r = m
i.w = g
i.o = j
g.v = d
g.y = a
g.s = c
g.w = n
n.x = c
l.r = g
l.w = m
l.o = j
assert j.t.o.y.w.r.txt == "n"