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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: F = None
        self.t: D = None
        self.s: G = None
        self.r: C = None
        self.txt = txt

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

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

f.w = l
f.t = l
f.q = d
c.r = d
c.s = d
c.t = j
c.o = e
c.w = b
c.u = b
c.v = a
g.q = d
g.t = i
g.v = b
b.r = g
l.p = f
j.p = c
j.q = a
j.t = b
j.s = i
j.r = g
i.w = c
e.r = i
e.s = i
e.t = a
e.o = c
e.w = b
e.u = b
e.v = j
a.p = e
a.q = j
a.t = b
a.s = d
a.r = g
d.w = e
assert c.w.r.q.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: G = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: F = None
        self.t: D = None
        self.s: G = None
        self.r: C = None
        self.txt = txt

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

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

f.w = l
f.t = l
f.q = d
c.r = d
c.s = d
c.t = j
c.o = e
c.w = b
c.u = b
c.v = a
g.q = d
g.t = i
g.v = b
b.r = g
l.p = f
j.p = c
j.q = a
j.t = b
j.s = i
j.r = g
i.w = c
e.r = i
e.s = i
e.t = a
e.o = c
e.w = b
e.u = b
e.v = j
a.p = e
a.q = j
a.t = b
a.s = d
a.r = g
d.w = e
assert c.w.r.q.w.r.txt == "i"