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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: E = None
        self.t: B = None
        self.s: F = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: E = None
        self.t: B = None
        self.s: F = None
        self.u: C = None
        self.txt = txt

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

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

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