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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: E = None
        self.r: D = None
        self.z: G = None
        self.p: A = None
        self.q: A = None
        self.w: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

f = A("f")
h = B("h")
n = C("n")
m = D("m")
g = E("g")
e = F("e")
a = G("a")
c = H("c")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: E = None
        self.r: D = None
        self.z: G = None
        self.p: A = None
        self.q: A = None
        self.w: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

f = A("f")
h = B("h")
n = C("n")
m = D("m")
g = E("g")
e = F("e")
a = G("a")
c = H("c")

f.u = g
f.w = g
f.x = g
f.q = h
f.t = c
f.p = m
f.v = e
f.y = n
h.u = f
h.p = f
h.q = f
h.y = g
h.r = m
h.z = a
h.w = c
n.w = m
m.v = h
m.t = h
m.y = f
g.t = c
e.z = g
e.u = g
e.x = g
e.q = n
e.r = h
e.y = h
e.w = f
e.s = m
a.o = m
c.v = g
assert a.o.t.z.o.y.u.t.txt == "c"