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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: F = None
        self.r: H = None
        self.v: I = None
        self.u: G = None
        self.o: E = None
        self.z: C = None
        self.x: G = None
        self.w: C = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: J = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: H = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: H = None
        self.t: B = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: D = None
        self.r: C = None
        self.s: B = None
        self.o: E = None
        self.p: D = None
        self.y: A = None
        self.q: J = None
        self.z: B = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: I = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: F = None
        self.y: J = None
        self.t: C = None
        self.v: I = None
        self.r: C = None
        self.s: C = None
        self.p: I = None
        self.z: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: B = None
        self.u: E = None
        self.y: C = None
        self.x: F = None
        self.z: E = None
        self.s: B = None
        self.q: E = None
        self.txt = txt

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

f.v = h
f.t = l
c.t = b
c.y = l
c.s = l
c.r = e
c.v = d
c.u = g
c.x = g
c.o = k
c.z = a
c.w = a
a.x = h
a.s = b
b.y = g
b.u = e
b.r = d
k.w = c
k.t = c
k.v = e
k.x = b
l.x = c
l.s = c
l.z = c
l.u = b
l.p = b
l.r = a
l.o = k
l.y = f
l.q = h
l.w = g
g.y = f
g.q = d
g.x = c
e.q = f
e.x = l
e.y = h
e.z = h
e.t = a
e.r = a
e.s = a
e.v = d
e.p = d
d.p = k
d.t = f
d.o = l
d.v = h
d.r = h
h.w = k
h.u = k
h.z = k
h.q = k
h.v = c
h.s = c
h.y = a
h.x = l
assert g.q.o.q.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: J = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: F = None
        self.r: H = None
        self.v: I = None
        self.u: G = None
        self.o: E = None
        self.z: C = None
        self.x: G = None
        self.w: C = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: J = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: H = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: H = None
        self.t: B = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: D = None
        self.r: C = None
        self.s: B = None
        self.o: E = None
        self.p: D = None
        self.y: A = None
        self.q: J = None
        self.z: B = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: I = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: F = None
        self.y: J = None
        self.t: C = None
        self.v: I = None
        self.r: C = None
        self.s: C = None
        self.p: I = None
        self.z: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: B = None
        self.u: E = None
        self.y: C = None
        self.x: F = None
        self.z: E = None
        self.s: B = None
        self.q: E = None
        self.txt = txt

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

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