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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: C = None
        self.y: D = None
        self.v: G = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: B = None
        self.z: B = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: B = None
        self.v: D = None
        self.u: D = None
        self.o: F = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.o: E = None
        self.u: C = None
        self.v: A = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: F = None
        self.y: F = None
        self.t: E = None
        self.v: F = None
        self.w: D = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: C = None
        self.y: D = None
        self.v: G = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: B = None
        self.z: B = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: B = None
        self.v: D = None
        self.u: D = None
        self.o: F = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.o: E = None
        self.u: C = None
        self.v: A = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: F = None
        self.y: F = None
        self.t: E = None
        self.v: F = None
        self.w: D = None
        self.q: B = None
        self.txt = txt

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

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