class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: G = None
        self.y: G = None
        self.s: D = 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.w: F = None
        self.u: B = None
        self.p: B = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: C = None
        self.txt = txt

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

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

d = A("d")
m = B("m")
k = C("k")
l = D("l")
c = E("c")
f = F("f")
i = G("i")

d.z = k
d.q = i
d.y = i
d.s = l
m.q = f
k.w = f
k.u = m
k.p = m
k.v = i
l.u = i
c.v = f
c.u = k
f.p = m
f.r = c
i.y = c
i.s = c
i.o = l
i.t = d
i.q = m
assert d.y.t.y.q.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: G = None
        self.y: G = None
        self.s: D = 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.w: F = None
        self.u: B = None
        self.p: B = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: C = None
        self.txt = txt

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

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

d = A("d")
m = B("m")
k = C("k")
l = D("l")
c = E("c")
f = F("f")
i = G("i")

d.z = k
d.q = i
d.y = i
d.s = l
m.q = f
k.w = f
k.u = m
k.p = m
k.v = i
l.u = i
c.v = f
c.u = k
f.p = m
f.r = c
i.y = c
i.s = c
i.o = l
i.t = d
i.q = m
assert d.y.t.y.q.q.p.txt == "m"