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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: A = None
        self.p: A = None
        self.u: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: J = None
        self.t: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: C = None
        self.u: G = None
        self.v: G = None
        self.txt = txt

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

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

f = A("f")
h = B("h")
m = C("m")
k = D("k")
e = E("e")
n = F("n")
d = G("d")
b = H("b")
j = I("j")
l = J("l")

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: A = None
        self.p: A = None
        self.u: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: J = None
        self.t: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: C = None
        self.u: G = None
        self.v: G = None
        self.txt = txt

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

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

f = A("f")
h = B("h")
m = C("m")
k = D("k")
e = E("e")
n = F("n")
d = G("d")
b = H("b")
j = I("j")
l = J("l")

f.o = d
f.u = e
h.w = n
h.t = f
h.p = f
h.u = b
m.u = k
m.v = k
m.q = k
k.v = e
e.u = l
e.v = k
n.v = h
n.q = l
n.t = b
d.u = m
d.y = k
d.v = f
b.x = m
b.r = m
b.u = d
b.v = d
j.t = k
j.w = f
j.o = m
l.u = n
l.x = d
l.p = k
l.r = k
l.v = j
l.y = h
assert n.v.w.t.x.u.v.u.txt == "l"