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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: A = None
        self.o: F = None
        self.x: C = None
        self.z: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: A = None
        self.o: F = None
        self.x: C = None
        self.z: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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