class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: F = None
        self.w: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

c = A("c")
h = B("h")
k = C("k")
m = D("m")
l = E("l")
i = F("i")
b = E("b")
g = C("g")
d = F("d")
n = A("n")

c.v = g
c.s = d
c.w = b
c.q = l
h.z = l
h.v = i
k.r = h
k.w = n
k.z = c
m.p = d
l.q = m
l.w = d
i.p = d
i.s = c
b.q = m
b.w = i
g.r = h
g.w = n
g.z = c
d.p = i
d.s = c
n.v = g
n.s = i
n.w = b
n.q = l
assert h.v.s.s.s.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: F = None
        self.w: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

c = A("c")
h = B("h")
k = C("k")
m = D("m")
l = E("l")
i = F("i")
b = E("b")
g = C("g")
d = F("d")
n = A("n")

c.v = g
c.s = d
c.w = b
c.q = l
h.z = l
h.v = i
k.r = h
k.w = n
k.z = c
m.p = d
l.q = m
l.w = d
i.p = d
i.s = c
b.q = m
b.w = i
g.r = h
g.w = n
g.z = c
d.p = i
d.s = c
n.v = g
n.s = i
n.w = b
n.q = l
assert h.v.s.s.s.v.z.txt == "c"