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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

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