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

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

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

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

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

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

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

d.v = l
g.r = e
g.x = j
g.p = l
g.v = l
g.u = m
n.r = m
l.z = d
l.u = h
l.p = k
l.r = n
h.v = l
h.q = j
a.o = g
a.w = n
k.v = l
j.v = l
j.q = h
e.r = g
e.x = h
e.p = l
e.v = l
e.u = a
m.o = g
m.w = n
assert m.o.u.w.r.w.r.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

d.v = l
g.r = e
g.x = j
g.p = l
g.v = l
g.u = m
n.r = m
l.z = d
l.u = h
l.p = k
l.r = n
h.v = l
h.q = j
a.o = g
a.w = n
k.v = l
j.v = l
j.q = h
e.r = g
e.x = h
e.p = l
e.v = l
e.u = a
m.o = g
m.w = n
assert m.o.u.w.r.w.r.o.x.txt == "j"