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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: G = None
        self.p: D = None
        self.s: D = None
        self.z: E = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: B = None
        self.t: F = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

g = A("g")
n = B("n")
j = C("j")
a = D("a")
k = E("k")
m = F("m")
c = G("c")
l = D("l")
h = D("h")

g.w = n
g.z = m
g.o = m
n.v = g
n.t = c
n.p = h
n.s = l
n.z = k
n.x = m
j.o = a
j.y = n
j.t = m
j.p = k
a.r = g
a.s = h
k.o = a
m.y = k
c.v = k
l.r = g
l.s = h
h.r = g
h.s = l
assert h.s.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: F = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: G = None
        self.p: D = None
        self.s: D = None
        self.z: E = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: B = None
        self.t: F = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

g = A("g")
n = B("n")
j = C("j")
a = D("a")
k = E("k")
m = F("m")
c = G("c")
l = D("l")
h = D("h")

g.w = n
g.z = m
g.o = m
n.v = g
n.t = c
n.p = h
n.s = l
n.z = k
n.x = m
j.o = a
j.y = n
j.t = m
j.p = k
a.r = g
a.s = h
k.o = a
m.y = k
c.v = k
l.r = g
l.s = h
h.r = g
h.s = l
assert h.s.s.s.s.s.txt == "l"