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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: A = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: C = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: G = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: A = None
        self.u: E = None
        self.txt = txt

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

l.x = n
l.v = c
l.u = f
h.x = n
h.z = n
f.r = l
f.u = c
f.x = n
j.s = l
j.r = l
j.z = n
c.x = n
c.t = f
c.q = f
c.p = f
n.y = g
n.x = b
n.v = f
b.o = h
b.t = l
b.u = c
g.s = l
g.r = l
g.z = n
assert c.q.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: E = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: A = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: C = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: G = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: A = None
        self.u: E = None
        self.txt = txt

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

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