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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: A = None
        self.q: F = None
        self.t: C = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: D = None
        self.p: B = None
        self.o: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: F = None
        self.txt = txt

f = A("f")
d = B("d")
j = C("j")
b = D("b")
i = E("i")
a = F("a")
l = G("l")

f.z = b
f.u = b
f.o = a
d.s = l
d.r = l
d.o = f
d.q = a
d.t = j
j.q = f
j.o = f
j.s = b
j.p = d
b.q = i
b.t = i
b.o = j
i.o = b
i.z = j
a.q = d
l.y = j
l.p = a
assert b.q.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: F = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: A = None
        self.q: F = None
        self.t: C = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: D = None
        self.p: B = None
        self.o: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: F = None
        self.txt = txt

f = A("f")
d = B("d")
j = C("j")
b = D("b")
i = E("i")
a = F("a")
l = G("l")

f.z = b
f.u = b
f.o = a
d.s = l
d.r = l
d.o = f
d.q = a
d.t = j
j.q = f
j.o = f
j.s = b
j.p = d
b.q = i
b.t = i
b.o = j
i.o = b
i.z = j
a.q = d
l.y = j
l.p = a
assert b.q.z.q.txt == "f"