class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: F = None
        self.o: E = None
        self.q: E = None
        self.t: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.txt = txt

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

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

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

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