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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: D = None
        self.t: D = None
        self.z: A = None
        self.r: B = None
        self.txt = txt

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

h = A("h")
j = B("j")
n = C("n")
b = D("b")
g = E("g")
d = F("d")
a = F("a")
c = D("c")

h.w = c
h.o = g
h.v = g
h.s = d
h.u = n
j.p = n
j.v = b
n.y = d
b.x = j
b.v = c
g.x = j
g.r = j
g.u = c
g.t = c
g.z = h
d.z = j
a.z = j
c.x = j
c.v = b
assert g.z.o.r.v.v.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: E = None
        self.s: F = None
        self.v: E = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: D = None
        self.t: D = None
        self.z: A = None
        self.r: B = None
        self.txt = txt

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

h = A("h")
j = B("j")
n = C("n")
b = D("b")
g = E("g")
d = F("d")
a = F("a")
c = D("c")

h.w = c
h.o = g
h.v = g
h.s = d
h.u = n
j.p = n
j.v = b
n.y = d
b.x = j
b.v = c
g.x = j
g.r = j
g.u = c
g.t = c
g.z = h
d.z = j
a.z = j
c.x = j
c.v = b
assert g.z.o.r.v.v.x.p.txt == "n"