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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: G = None
        self.y: D = None
        self.p: F = None
        self.z: A = None
        self.r: A = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: F = None
        self.y: A = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: F = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: A = None
        self.q: D = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

b = A("b")
g = B("g")
k = C("k")
a = D("a")
h = E("h")
e = F("e")
i = G("i")
d = F("d")

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: G = None
        self.y: D = None
        self.p: F = None
        self.z: A = None
        self.r: A = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: F = None
        self.y: A = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: F = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: A = None
        self.q: D = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

b = A("b")
g = B("g")
k = C("k")
a = D("a")
h = E("h")
e = F("e")
i = G("i")
d = F("d")

b.z = i
g.o = a
g.y = a
g.v = i
g.p = d
g.z = b
g.r = b
g.s = b
k.r = a
k.v = d
k.y = b
k.w = h
a.v = h
a.p = d
a.q = k
a.y = k
h.x = i
h.o = e
e.q = a
i.u = g
i.v = g
i.w = b
i.q = a
i.y = k
d.q = a
assert h.x.u.p.txt == "d"