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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: F = None
        self.u: G = None
        self.txt = txt

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

f = A("f")
i = B("i")
c = C("c")
h = D("h")
a = E("a")
g = F("g")
b = G("b")
l = F("l")

f.z = a
f.w = i
i.q = g
c.s = b
c.o = a
c.p = a
c.t = f
h.s = l
a.y = f
g.w = f
g.t = l
g.u = b
b.u = c
b.s = l
b.t = i
b.o = h
b.r = h
b.x = a
l.w = f
l.t = g
l.u = b
assert a.y.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: F = None
        self.u: G = None
        self.txt = txt

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

f = A("f")
i = B("i")
c = C("c")
h = D("h")
a = E("a")
g = F("g")
b = G("b")
l = F("l")

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