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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: G = None
        self.o: E = None
        self.q: A = None
        self.y: F = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: A = None
        self.t: G = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: F = None
        self.o: C = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: C = None
        self.w: G = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: A = None
        self.r: D = None
        self.txt = txt

b = A("b")
k = B("k")
g = C("g")
m = D("m")
f = E("f")
n = F("n")
l = G("l")

b.q = m
b.y = n
b.v = n
b.t = f
k.w = l
k.z = l
k.o = f
k.q = b
k.y = n
k.t = g
g.o = m
g.w = m
g.p = b
g.t = l
m.p = b
m.t = n
m.o = g
m.w = l
f.v = n
f.t = g
f.w = l
f.q = l
n.o = f
n.w = k
l.x = n
l.p = b
l.r = m
assert b.t.v.w.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: F = None
        self.v: F = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: G = None
        self.o: E = None
        self.q: A = None
        self.y: F = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: A = None
        self.t: G = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: F = None
        self.o: C = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: C = None
        self.w: G = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: A = None
        self.r: D = None
        self.txt = txt

b = A("b")
k = B("k")
g = C("g")
m = D("m")
f = E("f")
n = F("n")
l = G("l")

b.q = m
b.y = n
b.v = n
b.t = f
k.w = l
k.z = l
k.o = f
k.q = b
k.y = n
k.t = g
g.o = m
g.w = m
g.p = b
g.t = l
m.p = b
m.t = n
m.o = g
m.w = l
f.v = n
f.t = g
f.w = l
f.q = l
n.o = f
n.w = k
l.x = n
l.p = b
l.r = m
assert b.t.v.w.q.t.txt == "f"