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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: G = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: H = None
        self.u: A = None
        self.z: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: G = None
        self.p: E = None
        self.z: G = None
        self.v: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: G = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: H = None
        self.u: A = None
        self.z: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: G = None
        self.p: E = None
        self.z: G = None
        self.v: G = None
        self.txt = txt

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

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