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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: I = None
        self.y: J = None
        self.q: F = None
        self.t: A = None
        self.r: J = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: E = None
        self.y: H = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: D = None
        self.o: B = None
        self.w: I = None
        self.u: C = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: I = None
        self.x: C = None
        self.z: E = None
        self.s: G = None
        self.p: E = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: J = None
        self.w: F = None
        self.o: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

b = A("b")
a = B("a")
l = C("l")
h = D("h")
j = E("j")
i = F("i")
d = G("d")
c = H("c")
e = I("e")
f = J("f")

b.q = a
b.s = c
b.u = c
b.v = l
b.x = h
a.v = b
a.t = b
a.u = e
a.y = f
a.r = f
a.q = i
a.p = j
l.u = d
l.q = d
l.r = j
l.y = c
h.p = f
j.w = c
j.u = l
j.q = l
i.y = c
i.p = c
i.r = c
i.z = l
i.u = j
i.o = h
d.v = b
d.z = h
d.o = a
d.w = e
d.s = e
d.u = l
c.v = j
c.z = j
c.p = j
c.y = e
c.x = l
c.s = d
c.w = h
e.s = l
e.v = f
e.w = i
e.o = d
f.u = i
assert h.p.u.u.w.y.v.u.p.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: H = None
        self.v: C = None
        self.u: H = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: I = None
        self.y: J = None
        self.q: F = None
        self.t: A = None
        self.r: J = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: E = None
        self.y: H = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: D = None
        self.o: B = None
        self.w: I = None
        self.u: C = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: I = None
        self.x: C = None
        self.z: E = None
        self.s: G = None
        self.p: E = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: J = None
        self.w: F = None
        self.o: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

b = A("b")
a = B("a")
l = C("l")
h = D("h")
j = E("j")
i = F("i")
d = G("d")
c = H("c")
e = I("e")
f = J("f")

b.q = a
b.s = c
b.u = c
b.v = l
b.x = h
a.v = b
a.t = b
a.u = e
a.y = f
a.r = f
a.q = i
a.p = j
l.u = d
l.q = d
l.r = j
l.y = c
h.p = f
j.w = c
j.u = l
j.q = l
i.y = c
i.p = c
i.r = c
i.z = l
i.u = j
i.o = h
d.v = b
d.z = h
d.o = a
d.w = e
d.s = e
d.u = l
c.v = j
c.z = j
c.p = j
c.y = e
c.x = l
c.s = d
c.w = h
e.s = l
e.v = f
e.w = i
e.o = d
f.u = i
assert h.p.u.u.w.y.v.u.p.w.p.txt == "f"