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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: G = None
        self.w: D = None
        self.u: E = None
        self.q: E = None
        self.p: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: D = None
        self.o: C = None
        self.r: E = None
        self.u: E = None
        self.y: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

j = A("j")
i = B("i")
d = C("d")
g = D("g")
c = E("c")
e = F("e")
b = G("b")
n = E("n")
m = D("m")

j.q = e
j.v = n
i.y = g
i.w = g
i.o = b
i.p = b
i.u = n
i.q = n
d.u = j
d.w = e
g.w = d
c.x = n
c.r = n
c.u = n
c.y = n
c.p = m
c.o = d
e.o = b
b.w = j
b.y = d
n.x = c
n.r = c
n.u = c
n.y = c
n.p = g
n.o = d
m.w = d
assert g.w.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: G = None
        self.w: D = None
        self.u: E = None
        self.q: E = None
        self.p: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: D = None
        self.o: C = None
        self.r: E = None
        self.u: E = None
        self.y: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

j = A("j")
i = B("i")
d = C("d")
g = D("g")
c = E("c")
e = F("e")
b = G("b")
n = E("n")
m = D("m")

j.q = e
j.v = n
i.y = g
i.w = g
i.o = b
i.p = b
i.u = n
i.q = n
d.u = j
d.w = e
g.w = d
c.x = n
c.r = n
c.u = n
c.y = n
c.p = m
c.o = d
e.o = b
b.w = j
b.y = d
n.x = c
n.r = c
n.u = c
n.y = c
n.p = g
n.o = d
m.w = d
assert g.w.w.o.txt == "b"