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

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

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

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

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

c = A("c")
f = B("f")
k = C("k")
d = D("d")
m = E("m")

c.x = d
c.w = d
c.v = m
c.s = k
f.y = d
f.t = m
f.s = c
k.x = f
k.w = f
k.q = m
d.o = c
d.x = c
m.u = f
m.x = f
assert m.u.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: E = None
        self.w: D = None
        self.s: C = None
        self.txt = txt

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

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

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

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

c = A("c")
f = B("f")
k = C("k")
d = D("d")
m = E("m")

c.x = d
c.w = d
c.v = m
c.s = k
f.y = d
f.t = m
f.s = c
k.x = f
k.w = f
k.q = m
d.o = c
d.x = c
m.u = f
m.x = f
assert m.u.t.u.txt == "f"