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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: A = None
        self.z: A = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: D = None
        self.p: D = None
        self.t: D = None
        self.u: D = None
        self.w: F = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: G = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: G = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: B = None
        self.u: F = None
        self.p: F = None
        self.s: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: A = None
        self.z: A = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: D = None
        self.p: D = None
        self.t: D = None
        self.u: D = None
        self.w: F = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: G = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: G = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: B = None
        self.u: F = None
        self.p: F = None
        self.s: E = None
        self.txt = txt

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

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

b.q = g
b.w = g
b.s = f
a.t = l
a.x = b
a.z = b
a.y = g
g.r = f
g.w = f
g.q = d
g.p = d
g.t = d
g.u = d
g.y = i
d.y = f
d.z = l
d.r = l
i.o = a
i.s = l
i.t = l
e.t = l
e.x = a
e.u = f
e.p = f
e.s = m
l.t = d
l.p = d
l.x = f
f.t = l
f.x = a
f.u = e
f.p = e
f.s = m
m.o = a
m.s = l
m.t = l
assert e.t.p.y.txt == "f"