class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: D = None
        self.x: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: A = None
        self.x: D = None
        self.y: A = None
        self.o: F = None
        self.q: B = None
        self.p: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

l = A("l")
h = B("h")
f = C("f")
n = D("n")
i = E("i")
b = F("b")
d = G("d")
j = B("j")
c = C("c")
k = B("k")

l.q = j
l.w = n
l.x = d
h.y = l
f.s = c
f.u = b
n.q = d
n.z = c
i.r = b
i.o = b
i.s = l
i.y = l
i.x = n
i.q = h
i.p = h
b.p = d
b.t = k
d.v = k
j.y = l
c.s = f
c.u = b
k.y = l
assert d.v.y.q.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: D = None
        self.x: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: A = None
        self.x: D = None
        self.y: A = None
        self.o: F = None
        self.q: B = None
        self.p: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

l = A("l")
h = B("h")
f = C("f")
n = D("n")
i = E("i")
b = F("b")
d = G("d")
j = B("j")
c = C("c")
k = B("k")

l.q = j
l.w = n
l.x = d
h.y = l
f.s = c
f.u = b
n.q = d
n.z = c
i.r = b
i.o = b
i.s = l
i.y = l
i.x = n
i.q = h
i.p = h
b.p = d
b.t = k
d.v = k
j.y = l
c.s = f
c.u = b
k.y = l
assert d.v.y.q.y.x.txt == "d"