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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.u: C = None
        self.q: F = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: B = None
        self.p: F = None
        self.v: B = None
        self.u: E = None
        self.s: F = None
        self.txt = txt

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

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

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

e = A("e")
c = B("c")
h = C("h")
g = D("g")
n = E("n")
b = F("b")
f = C("f")
l = E("l")

e.s = h
e.v = g
c.z = l
c.p = e
c.u = h
c.q = b
c.s = g
h.x = f
h.w = c
h.v = c
h.p = b
h.s = b
h.u = l
g.p = f
g.o = f
g.w = e
g.v = b
g.x = l
n.w = l
n.t = g
n.r = g
b.x = l
f.x = h
f.w = c
f.v = c
f.p = b
f.s = b
f.u = n
l.w = n
l.t = g
l.r = g
assert h.w.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.u: C = None
        self.q: F = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: B = None
        self.p: F = None
        self.v: B = None
        self.u: E = None
        self.s: F = None
        self.txt = txt

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

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

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

e = A("e")
c = B("c")
h = C("h")
g = D("g")
n = E("n")
b = F("b")
f = C("f")
l = E("l")

e.s = h
e.v = g
c.z = l
c.p = e
c.u = h
c.q = b
c.s = g
h.x = f
h.w = c
h.v = c
h.p = b
h.s = b
h.u = l
g.p = f
g.o = f
g.w = e
g.v = b
g.x = l
n.w = l
n.t = g
n.r = g
b.x = l
f.x = h
f.w = c
f.v = c
f.p = b
f.s = b
f.u = n
l.w = n
l.t = g
l.r = g
assert h.w.p.v.txt == "g"