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

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

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

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

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

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

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

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

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

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

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

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

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

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

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