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

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

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

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

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

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

k = A("k")
n = B("n")
g = C("g")
e = D("e")
m = E("m")
d = F("d")
j = B("j")
f = D("f")

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

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

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

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

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

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

k = A("k")
n = B("n")
g = C("g")
e = D("e")
m = E("m")
d = F("d")
j = B("j")
f = D("f")

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