class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.o: F = None
        self.w: A = None
        self.p: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

i = A("i")
d = B("d")
n = C("n")
c = D("c")
f = E("f")
a = F("a")
b = G("b")
h = C("h")

i.p = n
i.s = f
d.u = f
d.q = i
n.z = h
n.u = d
n.o = a
n.p = a
n.v = a
n.w = i
c.t = i
f.w = i
f.y = c
a.w = b
a.u = i
b.y = c
h.z = n
h.u = d
h.o = a
h.p = a
h.v = a
h.w = i
assert h.w.s.w.p.p.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.o: F = None
        self.w: A = None
        self.p: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

i = A("i")
d = B("d")
n = C("n")
c = D("c")
f = E("f")
a = F("a")
b = G("b")
h = C("h")

i.p = n
i.s = f
d.u = f
d.q = i
n.z = h
n.u = d
n.o = a
n.p = a
n.v = a
n.w = i
c.t = i
f.w = i
f.y = c
a.w = b
a.u = i
b.y = c
h.z = n
h.u = d
h.o = a
h.p = a
h.v = a
h.w = i
assert h.w.s.w.p.p.u.p.txt == "n"