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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: D = None
        self.s: E = None
        self.w: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: D = None
        self.s: E = None
        self.w: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: F = None
        self.txt = txt

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

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