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

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: D = None
        self.s: E = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: D = None
        self.s: E = None
        self.p: B = None
        self.txt = txt

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

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

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

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