class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: G = None
        self.v: B = None
        self.y: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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