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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: A = None
        self.r: H = None
        self.u: A = None
        self.w: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: F = None
        self.x: C = None
        self.u: F = None
        self.o: G = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: F = None
        self.o: F = None
        self.w: E = None
        self.q: A = None
        self.x: G = None
        self.t: A = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: E = None
        self.u: B = None
        self.x: H = None
        self.v: G = None
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: A = None
        self.r: H = None
        self.u: A = None
        self.w: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: F = None
        self.x: C = None
        self.u: F = None
        self.o: G = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: F = None
        self.o: F = None
        self.w: E = None
        self.q: A = None
        self.x: G = None
        self.t: A = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: E = None
        self.u: B = None
        self.x: H = None
        self.v: G = None
        self.p: B = None
        self.txt = txt

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

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