class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: B = None
        self.z: F = None
        self.s: D = None
        self.q: H = None
        self.r: C = None
        self.u: E = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: A = None
        self.z: A = None
        self.y: D = None
        self.q: F = None
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: A = None
        self.o: G = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: G = None
        self.t: E = None
        self.o: B = None
        self.w: C = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: I = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: B = None
        self.txt = txt

b = A("b")
g = B("g")
j = C("j")
f = D("f")
i = E("i")
m = F("m")
k = G("k")
h = H("h")
l = I("l")

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: A = None
        self.z: A = None
        self.y: D = None
        self.q: F = None
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: A = None
        self.o: G = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: G = None
        self.t: E = None
        self.o: B = None
        self.w: C = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: I = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: B = None
        self.txt = txt

b = A("b")
g = B("g")
j = C("j")
f = D("f")
i = E("i")
m = F("m")
k = G("k")
h = H("h")
l = I("l")

b.t = f
b.s = f
b.x = g
b.z = m
b.q = h
b.y = h
b.r = j
b.u = i
g.r = i
g.u = b
g.z = b
g.y = f
g.t = f
g.q = m
j.v = h
f.v = g
f.t = b
i.r = b
i.z = b
i.o = k
i.s = h
m.v = i
m.t = i
m.p = k
m.o = g
m.w = j
m.y = h
k.u = i
k.x = i
k.t = l
k.v = j
h.s = k
h.p = g
l.x = h
l.v = g
assert l.v.z.z.w.v.s.t.x.txt == "h"