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

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

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

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

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

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

g = A("g")
b = B("b")
j = C("j")
i = D("i")
d = E("d")
c = F("c")
f = C("f")
a = B("a")
m = E("m")

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

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

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

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

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

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

g = A("g")
b = B("b")
j = C("j")
i = D("i")
d = E("d")
c = F("c")
f = C("f")
a = B("a")
m = E("m")

g.y = m
g.r = i
b.o = j
b.v = j
b.s = a
b.z = f
b.w = i
b.r = g
j.z = i
i.w = g
i.y = g
i.t = d
i.r = j
i.z = b
i.o = c
d.v = m
d.x = m
d.t = c
c.v = f
c.z = b
f.z = i
a.o = j
a.s = b
a.z = f
a.v = f
a.w = i
a.r = g
m.v = d
m.x = d
m.t = c
assert b.w.o.z.w.txt == "i"