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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: A = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: F = None
        self.s: B = None
        self.o: B = None
        self.z: B = None
        self.txt = txt

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

b = A("b")
g = B("g")
m = C("m")
f = D("f")
a = E("a")
j = F("j")
h = D("h")

b.o = j
b.s = j
b.p = j
b.y = f
g.w = f
g.v = f
m.q = a
f.p = j
f.q = b
f.w = g
a.q = g
a.s = g
a.o = g
a.z = g
a.p = j
j.q = m
j.p = b
j.z = b
h.p = j
h.q = b
h.w = g
assert j.q.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: F = None
        self.p: F = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: A = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: F = None
        self.s: B = None
        self.o: B = None
        self.z: B = None
        self.txt = txt

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

b = A("b")
g = B("g")
m = C("m")
f = D("f")
a = E("a")
j = F("j")
h = D("h")

b.o = j
b.s = j
b.p = j
b.y = f
g.w = f
g.v = f
m.q = a
f.p = j
f.q = b
f.w = g
a.q = g
a.s = g
a.o = g
a.z = g
a.p = j
j.q = m
j.p = b
j.z = b
h.p = j
h.q = b
h.w = g
assert j.q.q.p.txt == "j"