class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: B = None
        self.x: F = None
        self.v: F = None
        self.q: B = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: A = None
        self.y: C = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: E = None
        self.txt = txt

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

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

d = A("d")
j = B("j")
b = C("b")
l = D("l")
h = E("h")
g = F("g")

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: A = None
        self.y: C = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: E = None
        self.txt = txt

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

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

d = A("d")
j = B("j")
b = C("b")
l = D("l")
h = E("h")
g = F("g")

d.p = g
d.x = g
d.v = g
d.o = j
d.q = j
d.y = l
j.x = h
j.r = h
j.q = d
j.y = b
j.z = g
b.x = h
l.y = h
l.w = h
h.y = g
h.w = l
g.s = h
g.q = h
g.v = b
g.x = l
g.t = d
assert d.y.y.w.txt == "l"