class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: G = None
        self.x: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: C = None
        self.q: B = None
        self.p: D = None
        self.w: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: F = None
        self.u: H = None
        self.s: B = None
        self.x: A = None
        self.p: B = None
        self.r: H = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: F = None
        self.u: G = None
        self.w: F = None
        self.z: G = None
        self.txt = txt

j = A("j")
b = B("b")
m = C("m")
d = D("d")
f = E("f")
n = F("n")
g = G("g")
c = H("c")

j.s = g
j.w = g
j.x = f
b.r = d
b.v = f
b.o = g
m.o = g
d.u = g
f.x = n
f.s = m
f.q = b
f.p = d
f.w = d
n.t = j
g.v = b
g.s = b
g.p = b
g.o = n
g.u = c
g.r = c
g.x = j
g.q = d
c.s = j
c.o = n
c.w = n
c.u = g
c.z = g
assert c.o.t.x.x.t.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: G = None
        self.x: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: C = None
        self.q: B = None
        self.p: D = None
        self.w: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: F = None
        self.u: H = None
        self.s: B = None
        self.x: A = None
        self.p: B = None
        self.r: H = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: F = None
        self.u: G = None
        self.w: F = None
        self.z: G = None
        self.txt = txt

j = A("j")
b = B("b")
m = C("m")
d = D("d")
f = E("f")
n = F("n")
g = G("g")
c = H("c")

j.s = g
j.w = g
j.x = f
b.r = d
b.v = f
b.o = g
m.o = g
d.u = g
f.x = n
f.s = m
f.q = b
f.p = d
f.w = d
n.t = j
g.v = b
g.s = b
g.p = b
g.o = n
g.u = c
g.r = c
g.x = j
g.q = d
c.s = j
c.o = n
c.w = n
c.u = g
c.z = g
assert c.o.t.x.x.t.w.r.txt == "c"