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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: D = None
        self.v: G = None
        self.z: G = None
        self.q: A = None
        self.x: D = None
        self.p: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: F = None
        self.x: C = None
        self.v: F = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: D = None
        self.v: G = None
        self.z: G = None
        self.q: A = None
        self.x: D = None
        self.p: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: F = None
        self.x: C = None
        self.v: F = None
        self.w: A = None
        self.txt = txt

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

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